﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Dapper;
using Elight.Entity;
using Elight.Repository.Interfaces;
using Elight.Infrastructure.Settings;

namespace Elight.Repository
{
    public partial class AccessRepository : BaseRepository<Sys_Access>, IAccessRepository
    {
        /// <summary>
        /// 获取权限实体集合。
        /// </summary>
        /// <param name="ids">权限ID集合</param>
        /// <returns></returns>
        public IEnumerable<Sys_Access> GetList(params int[] ids)
        {
            using (IDbConnection conn = OpenSharedConnection())
            {
                string sql = @"SELECT * FROM SYS_ACCESS t WHERE t.Id IN @Ids AND t.IsDelete = 0";
                return conn.Query<Sys_Access>(sql, new { Ids = ids });
            }
        }
    }
}
